﻿/*
 *Author: Jeff Liu 
 *
 *Under MIT License
 *jebberwocky@gmail.com
 */
using System.ComponentModel;

namespace CtpGglMap.Windows.Control
{
    partial class GStaticMap
    {
        /// <summary> 
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary> 
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            //dispose image file 
            if (disposing && this._gimage != null)
                this._gimage.Dispose();
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Component Designer generated code

        /// <summary> 
        /// Required method for Designer support - do not modify 
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.MapPictureBox = new System.Windows.Forms.PictureBox();
            ((System.ComponentModel.ISupportInitialize)(this.MapPictureBox)).BeginInit();
            this.SuspendLayout();
            // 
            // MapPictureBox
            // 
            this.MapPictureBox.Location = new System.Drawing.Point(0, 3);
            this.MapPictureBox.Name = "MapPictureBox";
            this.MapPictureBox.Size = new System.Drawing.Size(150, 144);
            this.MapPictureBox.TabIndex = 0;
            this.MapPictureBox.TabStop = false;
            this.MapPictureBox.Click += new System.EventHandler(this.MapPictureBox_Click);
            this.MapPictureBox.MouseMove += new System.Windows.Forms.MouseEventHandler(this.MapPictureBox_MouseMove);
            // 
            // GStaticMap
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.Controls.Add(this.MapPictureBox);
            this.Name = "GStaticMap";
            ((System.ComponentModel.ISupportInitialize)(this.MapPictureBox)).EndInit();
            this.ResumeLayout(false);
        }

        #endregion

        private System.Windows.Forms.PictureBox MapPictureBox;

        private CtpGglMap.Impl.StaticGMap _gmap;

        /// <summary>
        /// image only will be fetched when Gmap setter is called
        /// </summary>
        [Category("Appearance")]
        [Description("Gets or sets the Gmap")]
        public CtpGglMap.Impl.StaticGMap Gmap 
        { 
            set 
            { 
                this._gmap = value;
                if (this._gmap != null)
                {
                    this.Height = this._gmap.Height;
                    this.Width = this._gmap.Width;
                    this.MapPictureBox.Height = this.Height;
                    this.MapPictureBox.Width = this.Width;
                }
                this.LoadMap();
            } get { return _gmap; }
        }

        //holder for map image, might be changed to file later on
        private System.Drawing.Image _gimage = null;
    }
}
